package labirynthPackage;

import java.io.IOException;

/**
 * @author Biserova Ekaterina, Baburkina Anastasia, Perminov Alexander
 */
public class Main {
    public static void main(String[] args) throws IOException{
        Labyrinth labyrinth = new Labyrinth();
        /*String S;
        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter a robot`s command: ");
        S = "W";
        while (!"Q".equals(S)) {
            S = scanner.next(); 
            S=S.toUpperCase();
            labyrinth.move(S);
            if (labyrinth.field.step(labyrinth.robot.getPos())) {
                System.out.print("You`re killed by STONE!");
                break;
            }
            if (labyrinth.isExit()){
                System.out.print("Robot is FREE!");
                break;
            }
        System.out.print(labyrinth.toString());
        }*/
        //Заполнить массив стоимостями путей!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        /*int[][] cost;
        for (int i=1; i<=labyrinth.field.numOfL; i++) {
             cost[0][i] = labyrinth.field.AStar(labyrinth.robot.getPos(), labyrinth.field.prizes[i]).length();   
        }*/
        Point start=new Point(labyrinth.robot.getPos().y,labyrinth.robot.getPos().x);
        Point finish=new Point(labyrinth.field.exit.y,labyrinth.field.exit.x);
        Way way = new Way();
        way.road = labyrinth.field.AStar(start, finish);
        if (!way.road.isEmpty()){
            //labyrinth.robotGoesTo(way);
            System.out.println(labyrinth.globalFind().toString());
            System.out.println(labyrinth.toString());
            System.out.print("Score: ");
            System.out.print(labyrinth.Score);
        }
        else {
            System.out.print("Wasted!");
        }
    }
}